extends Node
class_name SceneBase

func generateCoin():
	var coinBornPointsCount = $CoinBornPoints.get_child_count()
	var index = randi() % coinBornPointsCount
	var coinBornPoint = $CoinBornPoints.get_child(index) as Marker2D
	Global.createCorn(coinBornPoint.global_position, self)
	

func generateEnemy():
	var enemyContainer = get_node("EnemyContainer")
	var enemyBornPoints = get_node("EnemyBornPoints")
	var generateCount = randi_range(0, enemyBornPoints.get_child_count())
	var markers = []
	for i in range(generateCount):
		markers.push_back(enemyBornPoints.get_child(i))
		
	for i in range(generateCount):
		var markerIndex = randi_range(0, markers.size() - 1) 
		var marker = markers[markerIndex] as Marker2D
		Global.createEnemy(marker.global_position, enemyContainer)
		markers.remove_at(markerIndex)
	
	
	
